var g = QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation).QueryInterface(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow)
} catch(h) {
if (window.opener) {
var g = window.opener
}
}
var e = g.document.getElementById("urlbar");
e.focus();
e.select();
return false
}
}
var myListener = {
QueryInterface: function (b) {
if (b.equals(Components.interfaces.nsIAutoCompleteObserver)) {
u += '<table style="width: 100%;" cellpadding="0" cellspacing="0"><tr><td width="100%"><span class="thumbTitle">Patience a virtue... we are hunting for new relevant sites for you... stay tuned</span></td></tr></table>'
} else {
var z = NTK.prefs.getIntPref("loveID");
var i = NTK.prefs.getIntPref("numOfLove");
var A = new window.DOMParser();
var e = A.parseFromString(x, "text/xml");
var v = z,
B, r, s, C, nav;
for (var y = 0; y < i; v++) {
if (z == "" || e == null || e.getElementsByTagName("url") == null) {
u += '<span class="because">Pardon us - our suggestion engine will soon be back</span>';
break
}
if (e.getElementsByTagName("url")[v] == null) {
v = 0
}
if (e.getElementsByTagName("url")[v] == null) {
return
}
B = e.getElementsByTagName("url")[v].childNodes[0].nodeValue;
alert("Please upgrade your browser to use full functionality on this page")
}
}
}
function widthEl(b) {
var a;
if (document.layers) {
a = document.layers[b].clip.width
} else {
if (document.all && !document.getElementById) {
a = document.all[b].offsetWidth
} else {
if (document.getElementById) {
a = document.getElementById(b).offsetWidth
}
}
}
return a
}
function heightEl(b) {
var a;
if (document.layers) {
a = document.layers[b].clip.height
} else {
if (document.all && !document.getElementById) {
a = document.all[b].offsetHeight
} else {
if (document.getElementById) {
a = document.getElementById(b).offsetHeight
}
}
}
return a
}
function highLight(a) {
a.style.bgColor = "#FFFF99"
}
function noLight(a) {
a.style.bgColor = "#F6F6F6"
}
function setVarsForm(a) {
formVars = a
}
function gogo(a) {
window.location = a;
}
function nav(a) {
obj = document.getElementById("searchboxy");
obj.style.color = "#999";
obj.style.fontWeight = "normal";
try {
var c = QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation).QueryInterface(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow)
}
catch(b) {
if (window.opener) {
var c = window.opener
}
}
c.document.getElementById("urlbar").value = a;
window.location = a
}
function expandCollapse(d, a) {
var c, b;
c = document.getElementById(a);
b;
if (d == null || c == null) {
return
}
if (d.src == "chrome://newtabking/content/images/expand.png") {
var f = QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation).QueryInterface(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow)
} catch(c) {
if (window.opener) {
var f = window.opener
}
}
var b = f.document.getElementById("urlbar");
b.focus();
b.select()
}
rebuildFirstPage();
rebuildPage(getMainContent())
}
function ValidateTextBox(b) {
var a;
var c;
if (window.event) {
a = window.event.keyCode
} else {
if (b) {
a = b.which
} else {
return true
}
}
c = String.fromCharCode(a);
c = c.toLowerCase();
if ((a == null) || (a == 0) || (a == 8) || (a == 9) || (a == 13) || (a == 27)) {
return true
} else {
if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(c) > -1)) {
document.getElementsByTagName("uURLIndi")[1].innerHTML = '<img style="vertical-align:sub" src="images/error.png"/><b> Choose another name!</b>';
return
} else {
Lightbox.open({
content: "#shareDivID3",
player: "inline",
title: "Share (step 3 out of 3)",
height: 450,
width: 495
});
setTimeout(doFocus3, 1000)
}
} else {
document.getElementsByTagName("sharingProgress")[1].innerHTML = "Communication error. Check your Internet connectivity"
}
}
};
c.send(null);
return true
}
function share(b) {
var a, c = encodeURI("http://www.newtabking.com/share/" + NTK.prefs.getCharPref("shareUsername"));
switch (b) {
case 0:
a = "http://www.facebook.com/share.php?u=" + c + "&t=My top used sites (thanks New Tab King!)";
break;
case 1:
a = "http://twitter.com/home?status=Just shared my top used sites at " + c;
break;
case 2:
a = "http://www.myspace.com/Modules/PostTo/Pages/?l=3&u=" + c + "&t=My top used sites (thanks New Tab King!)&c=In case you care to take a look a my top used sites!";
break;
case 3:
a = "http://digg.com/submit?phase=2&url=" + c + "&title=My top used sites (thanks New Tab King!)&bodytext=See+what+New+Tab+King+for+Firefox+can+do+to+your+CTRL%2BT+experience.++Quick+intro+about+and+add-on+that+changes+the+Firefox+new+tab+navigation+way+of+life%0A%0Ahttp%3A%2F%2Fwww.newtabking.com";
break;
case 4:
a = "http://www.stumbleupon.com/submit?url=" + c + "&title=My top used sites (thanks New Tab King!)";
break;
case 5:
a = "http://del.icio.us/post?url=" + c + "&title=My top used sites (thanks New Tab King!)¬es=See+what+New+Tab+King+for+Firefox+can+do+to+your+CTRL%2BT+experience.++Quick+intro+about+and+add-on+that+changes+the+Firefox+new+tab+navigation+way+of+life%0A%0Ahttp%3A%2F%2Fwww.newtabking.com";
a += '<div align="left" style="font-size:x-small;color:#555;padding-left:13px;padding-right:13px">Stay tuned for personal suggested sites - we promise exciting findings.</div>';
d += ('<li id="row_' + b + '" style="height:10px" >');
d += createCheckbox(a[b].title, a[b].uri, 47, b, a[b].accessCount);
d += ('<span class="indexShare" style="width: ' + Math.round(a[b].accessCount * 94 / c) + '%">(' + a[b].accessCount + "%)</span>");
d += ("</li>")
}
numMostUsedSites = b;
d += ("</ul>");
d += ("</div>");
return d
}
function addHostToBlackTabList(g, h, e) {
var str = getRes("ConfirmRemoving");
answer = confirm(str + " :" + g );
if (answer == 0) {
return
}
var h, b, f, a, d;
h = 0;
for (d = 0; d < e; d++) {
b = document.getElementById("tabrow_" + d);
if (b != null) {
f = b.href;
if (f.indexOf(g) != -1) {
b.style.display = "none"
}
}
}
try {
a = NTK.prefs.getCharPref("blackTablist")
} catch(c) {
a = ""
}
if (!a) {
a = g
} else {
a += ";" + g
}
try {
NTK.prefs.setCharPref("blackTablist", a)
} catch(c) {
printObject("ex", c)
}
}
function showDelTab(a, b) {
var c = document.getElementById("deleteTabImg_" + a);
if (b == 1) {
c.style.display = ""
} else {
c.style.display = "none"
}
}
function launchFolder() {
var e, c, b, d, a;
e = Components.classes["@mozilla.org/file/directory_service;1"].getService(Components.interfaces.nsIProperties).get("Pers", Components.interfaces.nsIFile);
c = e.path;
b = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
b.initWithPath("c:\\windows\\explorer.exe");
d = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);